package lanqiao;

public class 门牌制作 {
    public static void main(String[] args) {
        System.out.println(process(2020));
    }
    public static int process(int n){
        int ans = 0;
        for (int i = 1; i <=n; i++) {
            if (i%10==2)
                ans++;
            if (i/10%10 == 2)
                ans++;
            if (i/1000%10 == 2)
                ans++;
            if (i/100%10 == 2)
                ans++;
        }
        return ans;
    }
}
